﻿using System;

using mvcForum.Core;
using mvcForum.Core.Abstractions;
using mvcForum.Core.Interfaces.Data;

namespace mvcForum.AddOns.Akismet {

	public class AkismetConfiguration : AsyncAddOnConfiguration<AkismetAddOn> {

		public AkismetConfiguration(IRepository<AddOnConfiguration> configRepo) : base(configRepo) { }

		private static class Keys {
			public const String AkismetKey = "AkismetKey";
			public const String Enabled = "Enabled";
			public const String MarkAsSpamOnHit = "MarkAsSpamOnHit";
			public const String SpamScore = "SpamScore";
		}

		public String Key {
			get {
				return this.GetString(Keys.AkismetKey);
			}
			set {
				this.Set(Keys.AkismetKey, value);
			}
		}

		public Boolean Enabled {
			get {
				return this.GetBoolean(Keys.Enabled);
			}
			set {
				this.Set(Keys.Enabled, value);
			}
		}

		public Boolean MarkAsSpamOnHit {
			get {
				return this.GetBoolean(Keys.MarkAsSpamOnHit);
			}
			set {
				this.Set(Keys.MarkAsSpamOnHit, value);
			}
		}

		public Int32 SpamScore {
			get {
				return this.GetInt32(Keys.SpamScore);
			}
			set {
				this.Set(Keys.SpamScore, value);
			}
		}
	}
}